﻿<%@ Page Language="C#"   AutoEventWireup="true" CodeBehind="WorkCategoryEntry.aspx.cs" Inherits="MTRC.ODMS.Web.SOM.CodeSetup.WorkCategoryEntry" %>

<%@ Register Assembly="APJ.Web.UI.WebControls" Namespace="APJ.Web.UI.WebControls"
    TagPrefix="APJ" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<%@ Register Src="~/UserControl/Menu/PageFoot.ascx" TagName="PageFoot" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/TabStrip.ascx" TagName="TabStrip" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/PageHead.ascx" TagName="PageHead" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="WebStructure" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Operational Data Management System</title>
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <link href="../../CSS/common.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../../Javascript/CommonFunction.js"></script>
    <script language="javascript">
        //Update By Gordon 20150702
        //Add parameter: seq
        //For U18,Mandatory Message
        function CheckData(desc1,seq,message)
        {
            if(trim(document.getElementById("txtCatEN").value)=="")
            {
                alert(desc1);
                return false;
            }
//            else if(trim(document.getElementById("txtCatCH").value)=="")
//            {
//                alert(desc2);
//                return false;
//            }
//            else if(trim(document.getElementById("txtCatHK").value)=="")
//            {
//                alert(desc3);
//                return false;
            //            }

            //Add By Gordon 20150702
            if (trim(document.getElementById("txtSequence").value) == "") {
                alert(seq);
                return false; 
            }
            
            if(document.getElementById("chkVoid").checked==true)
            {
                if(confirm(message))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            return true;
        }
    
        function Void(message)
        {
            if(document.getElementById("chkVoid").checked==true)
            {
                if(confirm(message))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            return true;

        }


        function IsInteger(val) {
            var re;
            re = /^[0-9]*[1-9][0-9]*$/;
            return re.exec(val);
        }

        function CheckInt(obj) {
            if (obj.value != "") {
                if (!IsInteger(obj.value)) {
                    obj.value = obj.title;
                    return false;
                }
                else
                    return true;
            }
            else
                return true;
        }
    </script>

    <link href="~/CSS/Menu.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">  
        <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
        </AjaxControlToolkit:ToolkitScriptManager>      
            <table border="0" cellpadding="0" cellspacing="0" class="Page_Container">
                <tr>
                   <td colspan="2" class="Page_Head">
                        <WebStructure:PageHead ID="PageHead" runat="server" />
                    </td>
                </tr>               
                <tr>
                    <td class="Page_Left">
                        <WebStructure:MainMenu ID="MainMenu" runat="server" AppPath="../../" CurrMenuID="M140905" />
                    </td>
                    <td class="Page_Right">
                       <table class="Page_Contents">
                          <tr>
                            <td class="TabStrip"><WebStructure:TabStrip ID="TabStrip" CurrMenuID="M140805" ParentMenuID="M140905" DMenuMode="CurrOnly" runat="server" /></td>
                          </tr>
                          <tr>
                            <td class="Contents" style="height: 16px">
                             
                             <!--**********context Begin *****************-->
                                  
                                    <div id="div_CodeSetup_Title" style="display:none;"><asp:Label ID="lbl_CodeSetupTitle" runat=server Font-Bold=true Text="Code setup: Work Catogory"></asp:Label></div>
                                  
                                <fieldset>
                                <legend class="Title1">
                                    <asp:Label ID="lblTitleCategoryEntry" runat="server" Text="CategoryEntry"></asp:Label></legend>
                                   <table width="100%" border="0">
                                    <tr>
                                        <td style="width: 174px">
                                            <asp:Label ID="lblCatEN" runat="server" Text="Work Category(EN)"></asp:Label><em>*</em>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCatEN" runat="server" MaxLength="40" Width="458px"></asp:TextBox>
                                            <asp:HiddenField ID="hidID" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 174px">
                                            <asp:Label ID="lblCatCH" runat="server" Text="Work Category(CH)"></asp:Label><em></em></td>
                                        <td>
                                            <asp:TextBox ID="txtCatCH" runat="server" MaxLength="40" Width="458px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 174px">
                                            <asp:Label ID="lblCatHK" runat="server" Text="Work Category(HK)"></asp:Label><em></em></td>
                                        <td>
                                            <asp:TextBox ID="txtCatHK" runat="server" MaxLength="40" Width="458px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:CheckBox ID="chkSignReq" runat="server" TextAlign="Right" />
                                            &nbsp;&nbsp;
                                            <asp:CheckBox ID="chkProtect" runat="server" TextAlign="Right"/>
                                            &nbsp; &nbsp;
                                                <asp:CheckBox ID="chkVoid" runat="server" Text="" TextAlign="Right" />
                                                <%-- Add By Gordon 20150702 U18 --%>
                                              &nbsp; &nbsp;
                                              <asp:Label ID="lblSequence" runat="server" Text="Sequence"></asp:Label><em>*</em>
                                              <asp:TextBox ID="txtSequence" onblur="CheckInt(this)" MaxLength="4"  runat="server"></asp:TextBox>
                                                </td>

                                            
                                        
                                    </tr>
                             
                                    <tr>
                                        <td colspan="2">
                                            <asp:HyperLink ID="hypToWorkCategory" runat="server" Font-Underline="True">To Work Category</asp:HyperLink></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="right">
                                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                                            <asp:Button ID="btnSaveAndReturn" runat="server" Text="Save And Return" OnClick="btnSaveAndReturn_Click" />
                                            <asp:Button ID="btnSaveAndNew" runat="server" Text="Save And New" OnClick="btnSaveAndNew_Click" />
                                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        </td>
                                    </tr>
                                   </table>
                                </fieldset>
                             <!--**********context End *****************-->
                            </td>
                          </tr>
                          <tr>
                            <td class="Page_Foot" style="height: 54px"><WebStructure:PageFoot ID="PageFoot" runat="server" /></td>
                          </tr>
                       </table>                                              
                    </td>
                </tr>                
            </table>        
    </form>
</body>
</html>
